package main;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public class main extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents( new Listen(), this);
        Bukkit.getConsoleSender().sendMessage("插件加载完毕");

    }


    @Override
    public void onDisable() {
        Bukkit.getConsoleSender().sendMessage("插件卸载完毕");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(command.getName().equalsIgnoreCase("hhh"))
        {

            Player targar = sender.getServer().getPlayer(sender.getName());
            targar.kickPlayer("bye~");

            return true;
        }


        return false;
    }
}
